﻿using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Linq.Expressions;

namespace Framework.DataAccess
{
    public interface IRepository<T> where T : class
    {
        Boolean Add(T entity);
        Boolean Update(T entity);
        Boolean Delete(T entity);
        Boolean Delete(Expression<Func<T, bool>> where);
        T GetById(long Id);
        T GetById(int Id);
        T GetById(string Id);
        T Get(Expression<Func<T, bool>> where);
        IEnumerable<T> GetAll();

        IEnumerable<T> GetMany(Expression<Func<T, bool>> where = null,
                               Func<IQueryable<T>, IOrderedQueryable<T>> orderBy = null,
                               string includeProperties = "");

        void SaveChanges();
    }
}
